<?php
require_once 'tpl/use/block/styleCore.php';
require_once 'tpl/use/block/pagerBar.php';

// I don't like having $start and $inc. Could revamp the pager
function skin_ShowPosts( $tnum, $posts, $count, $start, $inc ) {
  styleHead();

  echo "<a href=\"post.php?tnum=${tnum}\">Reply</a>"; 
  foreach( getPosts( $tnum, $start, $inc ) as $post ) {
    echo "<h1>{$post['name']} on ${post['date']} by {$post['uname']}</h1><br />",
         "<p>{$post['datum']}",
         "<a href=\"post.php?tnum=${post['tid']}&pnum=${post['rank']}\">Edit</a>", 
         "<a href=\"gulp.php?type=THREAD&action[delete]=true&tnum=${post['tid']}&pnum=${post['rank']}\">DELeTE</a></p>";
  }
  echo "<a href=\"post.php?tnum=${tnum}\">Reply</a>"; 

  pagerBar("page.php&type=POST?", $tnum, $count, $start, $inc);

  styleFoot();
}
?>
